<?php
/**
 * 优惠卡发放
 * @copyright (c) Seer All Rights Reserved
 */

require_once './globals.php';

$Card_Model = new Card_Model();
$action = $_POST['action'];

//课程报名初期化
if ($action == '' ) {
	$pwd = '优惠卡发放';
	include View::getView('header');
	require_once View::getView('card/give');
	include View::getView('footer');
	View::output();
}

// 优惠卡发放提交
if ($action == 'commit' ) {
	$card_id = $_POST['card_id'];
	$wx_openid = $_POST['wx_openid'];
	$Card_Model->addUserCard($card_id,$wx_openid);
	seerDirect("./card_give.php?active_add=1");
}